table.insert(itemActions,
	function(item, action)
		-- MAGIC/RARE barbarian helms
		-- see: dir .. "readme.txt" for information regarding these variables
		local priority = 4
		local identify = true
		local dump = true
	
		if not (item.baseItem.baseType.Type == ItemKind.PrimalHelm and
				(item.quality == ItemQuality.Magic or item.quality == ItemQuality.Rare)) then
			return false
		elseif action == aPICK and (not item.flags.Identified or isBoHelm(item)) then
			return priority
		elseif action == aIDENT then
			return identify
		elseif action == aSELL and item.flags.Identified and not isBoHelm(item) then
			return true
		elseif action == aDUMP and item.flags.Identified and not isBoHelm(item) then
			return dump
		end

		return false
	end
)

function isBoHelm(item)
	local bo, baba, cry = false, false, false

	for i = 0, item.mods:size() - 1 do
		if (item.mods[i].Stat.Type == StatType.SingleSkill and
			item.mods[i].Skill == SkillType.BattleOrders and
			item.mods[i].Value >=2 ) then
			bo = true
		elseif (item.mods[i].Stat.Type == StatType.ClassSkillsBonus and
			item.mods[i].Value == 2) then
			baba = true
		elseif (item.mods[i].Stat.Type == StatType.SkillTabBonus and
			item.mods[i].Tab == SkillTab.Warcries and
			item.mods[i].Value >= 2) then
			cry = true
		end
	end

	return (bo and (baba or cry))
end
